﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WickedFlame.Util.Controls">

    <Style TargetType="{x:Type Button}" x:Key="transparentButton">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border BorderThickness="0" Background="Transparent">
                            <ContentPresenter VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                              HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
											SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="{x:Type local:CanvasSelectionButton}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Width" Value="70" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CanvasSelectionButton}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="12"/>
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <Image Grid.Column="0" Grid.Row="0" Source="/VecDraw.Resources;component/Images/VecDraw.Pin.Dirty.png" Visibility="Hidden" HorizontalAlignment="Left" VerticalAlignment="Top" Name="pinDirtyDisplay" SnapsToDevicePixels="True" Stretch="None" Margin="2"/>

                        <Button x:Name="PART_CloseButton" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center" Width="10" Height="10" Style="{StaticResource transparentButton}">
                            <Viewbox Width="12" Height="12" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <Image Source="/VecDraw.Resources;component/Images/VecDraw.Pin.CloseRed.png" Stretch="None" SnapsToDevicePixels="True"/>
                            </Viewbox>
                        </Button>

                        <Border Name="ImageBorder" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,3" BorderBrush="Black" BorderThickness="0.5">
                            <Viewbox Name="ImageView">
                                <local:CanvasImage DrawingCanvas="{Binding DrawingCanvas}" />
                            </Viewbox>
                        </Border>

                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDirty" Value="true">
                            <Setter Property="Visibility" Value="Visible" TargetName="pinDirtyDisplay"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>